package com.hkts.sinoiov.sinoiovHisTrack.service.serviceimpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hkts.sinoiov.sinoiovHisTrack.entity.SinoiovHisTrack;
import com.hkts.sinoiov.sinoiovHisTrack.mapper.SinoiovHisTrackMapper;
import com.hkts.sinoiov.sinoiovHisTrack.service.ISinoiovHisTrackService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.apache.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.util.List;

/**
 * <p>
 * 轨迹 服务实现类
 * </p>
 *
 * @author hml
 * @since 2021-08-12
 */
@Service
@Transactional
public class SinoiovHisTrackServiceImpl extends ServiceImpl<SinoiovHisTrackMapper, SinoiovHisTrack> implements ISinoiovHisTrackService {


    @Autowired
    private SinoiovHisTrackMapper sinoiovHisTrackMapper;

    @Override
    public IPage<SinoiovHisTrack> selectPage(Page<SinoiovHisTrack> page, SinoiovHisTrack sinoiovHisTrack) {
        QueryWrapper<SinoiovHisTrack> query = Wrappers.query();
        QueryWrapper<SinoiovHisTrack> entityWrapper = getEntityWrapper(query, sinoiovHisTrack);
        return sinoiovHisTrackMapper.selectPage(page, entityWrapper);
    }


    @Override
    public List<SinoiovHisTrack> selectList(SinoiovHisTrack sinoiovHisTrack) {
        QueryWrapper<SinoiovHisTrack> query = Wrappers.query();
        QueryWrapper<SinoiovHisTrack> entityWrapper = getEntityWrapper(query, sinoiovHisTrack);
        return sinoiovHisTrackMapper.selectList(entityWrapper);
    }

    /**
     * 公共查询条件
     *
     * @param entityWrapper
     * @return
     */
    public QueryWrapper<SinoiovHisTrack> getEntityWrapper(QueryWrapper<SinoiovHisTrack> entityWrapper, SinoiovHisTrack sinoiovHisTrack) {

        return entityWrapper;
    }
}
